package io.github.codelifeleno.jdbrelease.execute;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ReUtil;
import io.github.codelifeleno.jdbrelease.model.finals.DefaultName;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.io.FileFilter;
import java.util.List;

class DBScriptFileServiceTest {

    @Test
    void executeScript() {
        List<File> files = FileUtil.loopFiles("F:\\Datas\\Workspace\\GitOnlineProjects\\JDBRelease\\commons\\src\\test\\resources\\db", new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return !pathname.getName().equals(DefaultName.DBScriptConfig_FileName) && !ReUtil.contains(DefaultName.RUNNING_DIRNAME, pathname.getAbsolutePath());
            }
        });
        for (File file : files) {
            System.out.println(file.getAbsolutePath());
        }
    }
}